home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / f90 / product.z / product
Encoding:
Text File  |  2002-10-03  |  3.7 KB  |  80 lines

  1. PRODUCT(3I)                                           Last changed: 4-13-99
  2.  
  3.  
  4. NNAAMMEE
  5.      PPRROODDUUCCTT - Forms the product of array elements
  6.  
  7. SSYYNNOOPPSSIISS
  8.      PPRROODDUUCCTT (([AARRRRAAYY==]_a_r_r_a_y [,,[DDIIMM==]_d_i_m] [,,[MMAASSKK==]_m_a_s_k]))
  9.  
  10. IIMMPPLLEEMMEENNTTAATTIIOONN
  11.      UNICOS, UNICOS/mk, IRIX systems
  12.  
  13.      CF90, MIPSpro 7 Fortran 90
  14.  
  15. SSTTAANNDDAARRDDSS
  16.      Fortran
  17.  
  18. DDEESSCCRRIIPPTTIIOONN
  19.      The PPRROODDUUCCTT intrinsic function forms the product of all the elements
  20.      of _a_r_r_a_y along dimension _d_i_m corresponding to the true elements of
  21.      _m_a_s_k.  It accepts the following arguments:
  22.  
  23.      _a_r_r_a_y     Must be of type integer, real, or complex.  It must not be
  24.                scalar.
  25.  
  26.      _d_i_m       Must be scalar and of type integer with a value in the range
  27.                1 <= _d_i_m <= _n, where _n is the rank of _a_r_r_a_y.  The
  28.                corresponding actual argument must not be an optional dummy
  29.                argument.
  30.  
  31.      _m_a_s_k      Must be of type logical and must be conformable with _a_r_r_a_y.
  32.  
  33.      PPRROODDUUCCTT is a transformational intrinsic function.  The name of this
  34.      intrinsic cannot be passed as an argument.
  35.  
  36. RREETTUURRNN VVAALLUUEESS
  37.      The result has the same type and type parameter as _a_r_r_a_y.  The result
  38.      is scalar if _d_i_m is absent or _a_r_r_a_y has rank one; otherwise, the
  39.      result is an array of rank _n-1 of shape
  40.      (_d , _d , ..., _d     , _d     , ..., _d ),
  41.        1   2        _d_i_m-1   _d_i_m+1        _n
  42.      where (_d , _d , ..., _d )
  43.              1   2        _n
  44.      is the shape of _a_r_r_a_y.
  45.  
  46.      The result of PPRROODDUUCCTT((_a_r_r_a_y)) has a value equal to the product of all
  47.      the elements of _a_r_r_a_y or has the value 1 if _a_r_r_a_y has size 0.
  48.  
  49.      The result of PPRROODDUUCCTT((_a_r_r_a_y,,MMAASSKK==_m_a_s_k)) has a value equal to the
  50.      product of the elements of _a_r_r_a_y corresponding to the true elements of
  51.      _m_a_s_k or has the value 1 if there are no true elements.
  52.  
  53.      If _a_r_r_a_y has rank one, PPRROODDUUCCTT((_a_r_r_a_y,,_d_i_m[,,_m_a_s_k])) has a value equal to
  54.      that of PPRROODDUUCCTT((_a_r_r_a_y[,,MMAASSKK==_m_a_s_k])).  Otherwise, the value of element
  55.      (_s , _s , ..., _s     , _s     , ..., _s )
  56.        1   2        _d_i_m-1   _d_i_m+1        _n
  57.      of PPRROODDUUCCTT((_a_r_r_a_y,,_d_i_m[,,_m_a_s_k])) is equal to
  58.      PPRROODDUUCCTT((_a_r_r_a_y (_s , _s , ..., _s     , : , _s     , ..., _s ))))
  59.                      1   2        _d_i_m-1       _d_i_m+1        _n
  60.      [,, MMAASSKK==_m_a_s_k ((_s , _s , ..., _s     , : , _s     , ..., _s ))])).
  61.                     1   2        _d_i_m-1       _d_i_m+1        _n
  62. EEXXAAMMPPLLEESS
  63.      Example 1:  The value of PPRROODDUUCCTT((((// 11,, 22,, 33 //)))) is 6.
  64.  
  65.      Example 2:  PPRROODDUUCCTT((CC,, MMAASSKK == CC ..GGTT.. 00..00)) forms the product of the
  66.      positive elements of CC.
  67.  
  68.      Example 3:  BB is the following array:
  69.  
  70.      | 1 3 5 |
  71.  
  72.      | 2 4 6 |
  73.  
  74.      PPRROODDUUCCTT((BB,, DDIIMM == 11)) is ((//22,, 1122,, 3300//)), and PPRROODDUUCCTT((BB,, DDIIMM == 22)) is ((//1155,,
  75.      4488//)).
  76.  
  77. SSEEEE AALLSSOO
  78.      _I_n_t_r_i_n_s_i_c _P_r_o_c_e_d_u_r_e_s _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l for the printed version of this
  79.      man page.
  80.